<!DOCTYPE html>
<html>

<head>
    <title>意见反馈</title>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1,user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="telephone=no" name="format-detection">
    <link rel="stylesheet" type="text/css" href="/resource/web/css/reset.css">
    <link rel="stylesheet" type="text/css" href="/resource/web/css/flex.css">
    <link rel="stylesheet" type="text/css" href="/resource/web/css/accounts-child.css">
    <script type="text/javascript" src="/resource/web/js/flexible.js"></script>
    <script type="text/javascript" src="/resource/web/js/jquery-1.11.1.min.js"></script>
</head>

<body>
    <div class="mod-tit">
        <div class="title">
            <p>意见反馈</p>
            <a href="/Web/user_accounts"><img class="back" src="/resource/web/img/newhead/path_7_copy.png"></a>
        </div>
    </div>
    <div class="sugg">
        <textarea id="tmp" clos="20">请输入问题或建议</textarea>
    </div>
    <div class="sugg-tell">
        <input id="phone" type="" name="" placeholder="联系电话（选填）">
    </div>
    <div class="wd-btn">提交</div>
<script type="text/javascript">
    var tmp = document.getElementById("tmp");
    tmp.onfocus = function(){
        if(this.value == "请输入问题或建议"){
            this.value = "";
        }else if(this.value == ""){
            this.value = "请输入问题或建议";
        }
    }
    tmp.onblur = function(){
        if(this.value == "请输入问题或建议"){
            this.value = "";
        }else if(this.value == ""){
            this.value = "请输入问题或建议";
        }
    }
    $(".wd-btn").click(function(){
        var tmp = $("#tmp").val();
        var phone = $("#phone").val();
        if(tmp =="" || tmp=="请输入问题或建议"){
           alert("内容不能为空");
            return false;
        }
        $.ajax({
            url: '/Web/tucao.html',
            type : "POST",
            data: {content:tmp,phone:phone},
            dataType : "json",
            cache:"false",
            timeout:30000,
            success : function(json) {
                console.log(json.data);
                if(json.code == 1){
                    alert('意见反馈成功');
                    location="/Web/user_accounts";
                }else{
                    alert('意见反馈失败');
                    location="/Web/feedback.html";
                }

            }

        });
    })
</script>
</body>

</html>
